<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <base target="_self"/>
    <link rel="stylesheet" type="text/css" href="<%=path %>/web/style/layout.css" />
    <script type="text/javascript" src="<%=path %>/jqGrid/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="<%=path %>/jslib/jquery.validate.min.js"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/My97DatePicker/WdatePicker.js" defer="defer"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/jquery.form.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/jslib/additional-methods.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/demo.css">
	<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
    <c:if test="${requestScope.message!=null}">
		<script type="text/javascript">
 	 		     alert('<c:out value="${requestScope.message}"></c:out>');
 	 		     window.close();
 		</script>
	</c:if>
	
    <script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    var stateValue="";
    $().ready(function(){
			var options = {
		  	    url:'<%=request.getContextPath() %>/eqAction!updateJiLiangEXEC.action',
		  	     beforeSubmit: function() {
		   				return checking();
		    			},
		  	    dataType:'json',
		  	    success: function(data) {
		  	      if(data.result=='success'){
					alert("修改成功");
					api.close();
					W.reload();
		  	      }
		  	    }};
		$('#saveBtn').click(function(){
			    	$('#pageFrom').ajaxSubmit(options);
	 	            return false;
    	 });
    	$('#closeBtn').click(function(){
    		api.close();
		});
		
	});
	
   	function checking(){
   		var flag = true;
		var equipmentClfw = $.trim($("#equipmentClfw").val());
		var equipmentGllb = $.trim($("#equipmentGllb").val());
		var equipmentBqdd = $.trim($("#equipmentBqdd").val());
		var equipmentJdzt = $.trim($("#equipmentJdzt").val());
		var equipmentJdjzrq = $.trim($("#equipmentJdjzrq").val());
		
		var equipmentJdjzyxq = $.trim($("#equipmentJdjzyxq").val());
		var equipmentQrjg = $.trim($("#equipmentQrjg").val());
		var equipmentJddw = $.trim($("#equipmentJddw").val());
		var equipmentJllb = $.trim($("#equipmentJllb").val());
		var equipmentJdlx = $.trim($("#equipmentJdlx").val());
		
		var equipmentQrfs = $.trim($("#equipmentQrfs").val());
		var equipmentSjlx = $.trim($("#equipmentSjlx").val());
		var equipmentJdcd = $.trim($("#equipmentJdcd").val());
		
		
		if(equipmentClfw ==null || equipmentClfw == "" ){
			alert("测量范围不能为空！");
			$("#equipmentClfw").focus();
    		return false;
		}
		if(equipmentGllb ==null || equipmentGllb == "" ){
			alert("管理类别不能为空！");
			$("#equipmentGllb").focus();
    		return false;
		}
		if(equipmentBqdd ==null || equipmentBqdd == "" ){
			alert("展不确定度/最大允差/准确度等级不能为空！");
			$("#equipmentBqdd").focus();
    		return false;
		}
		if(equipmentJdzt ==null || equipmentJdzt == "" ){
			alert("检定状态不能为空！");
			$("#equipmentJdzt").focus();
    		return false;
		}
		
		if(equipmentJdjzrq ==null || equipmentJdjzrq == "" ){
			alert("请选择检定/校准日期！");
			$("#equipmentJdjzrq").focus();
    		return false;
		}
		if(equipmentJdjzyxq ==null || equipmentJdjzyxq == "" ){
			alert("请选择检定/校准有效期！");
			$("#equipmentJdjzyxq").focus();
    		return false;
		}
		if(equipmentQrjg ==null || equipmentQrjg == "" ){
			alert("确认间隔不能为空！");
			$("#equipmentQrjg").focus();
    		return false;
		}
		if(equipmentJddw ==null || equipmentJddw == "" ){
			alert("检定单位不能为空！");
			$("#equipmentJddw").focus();
    		return false;
		}
		if(equipmentJllb ==null || equipmentJllb == "" ){
			alert("计量类别不能为空！");
			$("#equipmentJllb").focus();
    		return false;
		}
		
		if(equipmentJdlx ==null || equipmentJdlx == "" ){
			alert("检定类型不能为空！");
			$("#equipmentJdlx").focus();
    		return false;
		}
		if(equipmentQrfs ==null || equipmentQrfs == "" ){
			alert("确认方式不能为空！");
			$("#equipmentQrfs").focus();
    		return false;
		}
		if(equipmentSjlx ==null || equipmentSjlx == "" ){
			alert("送检类型不能为空！");
			$("#equipmentSjlx").focus();
    		return false;
		}
		if(equipmentJdcd ==null || equipmentJdcd == "" ){
			alert("检定场地不能为空！");
			$("#equipmentJdcd").focus();
    		return false;
		}
	}
	 
	function checkExp(inputData){ 
		var regEx = new RegExp(/^(([^\^\.<>%&',:;=?$"'#@!~\]\[{}【】￥（）！·‘’”“。，、？：；—|\/\\/`\|])*)$/);
		var result = inputData.match(regEx);
		if (result == null) {
			return false;
		}
		return true;
	}
	function checkNum(inputData){
		var sNumber;
	    sNumber=Number(inputData);
	    if (isNaN(inputData)){
	       return false;
	     }
	    return true;
	}
	function countlen1(textarea){
	       var elem = event.relatedTarget || event.srcElement || event.target ||event.currentTarget;    
	        if(event.keyCode!=8)
			{
			  if (textarea.value.length> 249){
			        alert("最多为250个字符,字符输入超出限制!");
			        textarea.value=textarea.value.substring(0,249);
			    }
			    return true;
	 	    }
	}
		


   </script>
 	<style type="text/css">
 		body{
 			background:#ffffff; background-image:url(images/);
 		}
   		html{
		    overflow-x: hidden;
			overflow-y: hidden;
		}  	
		.formTableNew textarea{border: 1px solid #999;padding: 5px;width: 760px;-moz-border-radius: 3px;border-radius: 3px;margin-bottom: 5px;color: #666;background: url(../images/input_bg.gif) repeat-x top;}
   </style>
  </head>
  
  <body>
<form id="pageFrom" action="" enctype="multipart/form-data" method="post">
        <input type="hidden" id="flag" name="flag" />
  		<table width="100%" border="0" align="center" cellpadding="5" cellspacing="5" class="formTableNew">
  		<input id="equMainId" type="hidden" name="equMainId" value="${jlInfo.equMainId}"/>
  		<input id="equHtId" type="hidden" name="jlInfo.id" value="${jlInfo.id}"/>
  			<tr>
  			  <td align="right">测量范围：</td>
  			  <td align="left">
  			    <input  type="text"  id="equipmentClfw" maxlength="50" name="jlInfo.equipmentClfw" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentClfw }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">管理类别：</td>
  			  <td align="left">
  			  	<input  type="text"  id="equipmentGllb" maxlength="50" name="jlInfo.equipmentGllb" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentGllb }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">展不确定度/最大允差/准确度等级：</td>
  			  <td align="left">
  			    <input  type="text"  id="equipmentBqdd" maxlength="50" name="jlInfo.equipmentBqdd" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentBqdd }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">计划送检时间：</td>
  			  <td align="left">
  			    <input  type="text"  id="equipmentJhsjsj" maxlength="50" name="jlInfo.equipmentJhsjsj" onClick="WdatePicker()" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentJhsjsj }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">检定状态：</td>
  			  <td align="left">
  			    <input  type="text"  id="equipmentJdzt" maxlength="50" name="jlInfo.equipmentJdzt" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentJdzt }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">检定/校准日期：</td>
  			  <td align="left">
  			  	<input  type="text"  id="equipmentJdjzrq" maxlength="50" name="jlInfo.equipmentJdjzrq" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'equipmentJdjzyxq\');}'})" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${requestScope.jdjzrq }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">检定/校准有效期：</td>
  			  <td align="left">
  			    <input  type="text"  id="equipmentJdjzyxq" maxlength="50" name="jlInfo.equipmentJdjzyxq" onClick="WdatePicker({minDate:'#F{$dp.$D(\'equipmentJdjzrq\');}'})" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${requestScope.jdjzyxq }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">确认间隔：</td>
  			  <td align="left">
  			  	<input  type="text"  id="equipmentQrjg" maxlength="50" name="jlInfo.equipmentQrjg" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentQrjg }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">检定单位：</td>
  			  <td align="left">
  			    <input  type="text"  id="equipmentJddw" maxlength="50" name="jlInfo.equipmentJddw" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentJddw }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">计量类别：</td>
  			  <td align="left">
  			  	<input  type="text"  id="equipmentJllb" maxlength="50" name="jlInfo.equipmentJllb" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentJllb }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">检定类型：</td>
  			  <td align="left">
  			    <input  type="text"  id="equipmentJdlx" maxlength="50" name="jlInfo.equipmentJdlx" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentJdlx }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">确认方式：</td>
  			  <td align="left">
  			  	<input  type="text"  id="equipmentQrfs" maxlength="50" name="jlInfo.equipmentQrfs" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentQrfs }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">送检类型：</td>
  			  <td align="left">
  			    <input  type="text"  id="equipmentSjlx" maxlength="50" name="jlInfo.equipmentSjlx" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentSjlx }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">检定场地：</td>
  			  <td align="left">
  			  	<input  type="text"  id="equipmentJdcd" maxlength="50" name="jlInfo.equipmentJdcd" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentJdcd }" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			 <td align="right">厂内编号：</td>
  			  <td align="left">
  			    <input  type="text"  id="equipmentCnbh" maxlength="50" name="jlInfo.equipmentCnbh" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentCnbh }" />
  			  </td>
  			  <td align="right">器具名称：</td>
  			  <td align="left">
  			  	<input  type="text"  id="equipmentQjmc" maxlength="50" name="jlInfo.equipmentQjmc" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentQjmc }" />
  			  </td>
  			</tr>
  			<tr>
  			 <td align="right">管理状态：</td>
  			  <td align="left">
  			    <input  type="text"  id="equipmentGlzt" maxlength="50" name="jlInfo.equipmentGlzt" style="border: 1px solid #999;padding: 5px;width: 250px;height:25px;"  value="${jlInfo.equipmentGlzt }" />
  			  </td>
  			</tr>
 			<tr>
		    <td align="right">检定/校准证书：</td>
		    <td align="left">
		    	<jsp:include page="../fileupload/attachment.jsp?id=${jlInfo.id}&column=equipmentJdjzFile&show=n" ></jsp:include>
		    </td>
		  </tr>
		  <tr>
		    <td align="right">确认报告：</td>
		    <td align="left">
		    	<jsp:include page="../fileupload/attachment.jsp?id=${requestScope.equJlId}&column=equipmentQrbg&show=n" ></jsp:include>
		    </td>
		  </tr>
		</table>
		<table width="100%" border="0" align="center" class="formTableNew">
		  <tr>
			<td align="center">
		    	<input id="saveBtn" type="button" value="提 交" class="form_bt_orange" />
		    	<input type="button" id="closeBtn" value="取 消" class="form_bt_grey" />
		    </td>
		  </tr>
		</table>
	<!--表单结束-->
	</form>
  </body>
</html>
